#pragma once

#include "lg.h"
#include "lg_init.h"
#include "lg_ref.h"

struct LGTexture {
    LGRef ref;
    unsigned width;
    unsigned height;
    int format;
    int minFilter;
    int maxFilter;
    int sWrap;
    int tWrap;
    LGVector borderColor;
};


struct LGTextureBackend {
    size_t(*sizeofTexture)();
    int (*newTexture)(LGTexture* tex);
    int (*freeTexture)(LGTexture* tex);
    int (*uploadPixel)(LGTexture* tex,
        int format, unsigned rect[4], const void* data);
    void (*setFilter)(LGTexture* tex);
    void (*setWrap)(LGTexture* tex);

};

LG_API void
lgInitTextureContext(
    LGConfig* config, LGTextureBackend* backend);
